﻿namespace DelegatesExample
{
    using System;
    using System.Threading;

    public delegate void TimerDelegate();

    public static class Timer
    {
        private static int interval;
        private static int secondInterval;

        public static int Interval
        {
            get
            {
                return interval;
            }

            set
            {
                interval = value * 1000;
            }
        }

        public static int SecondInterval
        {
            get
            {
                return secondInterval;
            }

            set
            {
                secondInterval = value * 1000;
            }
        }

        public static void ExecuteEachOneSec()
        {
            Thread.Sleep(Interval);
            Console.WriteLine("1 sec");
        }

        public static void ExecuteEachThreeSec()
        {
            Thread.Sleep(SecondInterval);
            Console.WriteLine("3 sec");
        }
    }
}